const now =new Date();
let day=now.getDate();
const weekdays=['星期日','星期一','星期二','星期三','星期四','星期五','星期六']
let index=now.getDay();
const days=document.querySelector('.timebottom');
const weeks=document.querySelector('.timetop');
days.innerHTML=day;
weeks.innerHTML=weekdays[index];
const lists=document.querySelectorAll('.reli');
const radios=document.querySelectorAll('.radio')
const images=document.querySelectorAll('.imaging')
const incontent=document.querySelectorAll('.h2')
const inextracontent=document.querySelectorAll('.relists .reli p')
const newmiddleneh=document.querySelectorAll('.neh')
const newmiddlenec=document.querySelectorAll('.nec')
const cnums=document.querySelectorAll('.rebottom i')
const recontents=document.querySelectorAll('.recontent')
ii=1;
nn=0;
axios.defaults.baseURL="http://w6aqtw.natappfree.cc"
axios.get("/home/recommend",{
}).then(({data:{data}})=>{
    console.log(data); 
    data.forEach(function(e,index){
         console.log(e);
         images[index].src=e.imageUrl;
        //  console.log(index);        
         if(e.rtype==1){ 
            cnums[index].innerHTML=e.amount; 
            recontents[index].innerHTML=e.content;        
            if(e.type==1){
                radios[index].style.display='inline-block';
            }
         }
         if(e.rtype==2){
            cnums[index].innerHTML=e.amount;
            incontent[ii].innerHTML=e.content;
            inextracontent[ii].innerHTML=e.extraContent;
            ii++;
         }
         if(e.rtype==3){
            newmiddleneh[nn].innerHTML=e.content;
            newmiddlenec[nn].innerHTML=e.extraContent;
            nn++;
         }       
    }) 
});
